using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Trigits
{
    class StartScreen : TriominoeStack
    {
        Vector2[] locationSpeeds;
        float[] rotationSpeeds;

        public StartScreen(Rectangle bounds, int max, SpriteFont font) : base(bounds, max, font)
        {
            Random rnd = new Random();

            locationSpeeds = new Vector2[triominoes.Length];
            rotationSpeeds = new float[triominoes.Length];

            for (int i = 0; i < triominoes.Length; i++)
            {
                locationSpeeds[i] = new Vector2((float)(rnd.NextDouble() * 2 - 1), (float)(rnd.NextDouble() * 2 - 1));
                rotationSpeeds[i] = (float)(rnd.NextDouble() * 2 - 1);
                triominoes[i].flip(true);
            }
        }

        public void Update(GameTime gameTime)
        {
            for (int i = 0; i < triominoes.Length; i++)
            {
                triominoes[i].rotate(rotationSpeeds[i]);
                triominoes[i].move(locationSpeeds[i]);
            }
        }
    }
}
